﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Kronos.Pages
{
    public partial class AdminControl : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string admin_user;
            //make sure nobody changes url to enter in
            if (Request.QueryString["Admin"] == null || Request.QueryString["Admin"] == "") { Response.Redirect("~/Default.aspx"); }
            //decrypt url and store it in a string
            if (Request.QueryString["Admin"] != null) { admin_user = Decode_BASE64(Request.QueryString["Username"]); }

        }
        public static string Decode_BASE64(string encodedData)
        {
            byte[] encodedDataAsBytes = System.Convert.FromBase64String(encodedData);
            return System.Text.Encoding.Unicode.GetString(encodedDataAsBytes);
        }

    }
}